


use RFS_master_data, clear

   * save the p-values for testing equality between coefficients:
 	 mat UALL = J(5,5,1)
 
 	 local gg = 1

  *** BASELINE REGRESSION WITH INTERACTION TERMS:
      global vars3 "    N_aver N_coun   N_3hour N_BuSe N_IDB   " 

    foreach j of global vars3 {
di "`j'"
qui {
 cap drop yy xx*
 gen yy = `j'
 gen xx = size
 gen xxActive = activeZ  
 qui winsor2 xx , replace cuts(1 99)
  qui winsor2 yy , replace cuts(1 99)
 
 cap estimates drop f*
  
 	reghdfe yy  i.xxActive#c.xx      , absorb(st0_date#instrumentid#xxActive      )    cluster(call   st0_date)
  estimates store ff1
   test 1.xxActive#c.xx = 0.xxActive#c.xx
   	    local gg2 = r(p)
        mat UALL[1,`gg'] = `gg2'
   
 	reghdfe yy  i.xxActive#c.xx      , absorb(st0_date#instrumentid#xxActive  call      )    cluster(call   st0_date)
  estimates store ff2
   test 1.xxActive#c.xx = 0.xxActive#c.xx
     local gg2 = r(p)
        mat UALL[2,`gg'] = `gg2'
   
 	reghdfe yy  i.xxActive#c.xx  , absorb(st0_date#instrumentid#xxActive  call coun#xxActive     )    cluster(call   st0_date)
  estimates store ff3
   test 1.xxActive#c.xx = 0.xxActive#c.xx
     local gg2 = r(p)
        mat UALL[3,`gg'] = `gg2'

 	reghdfe yy  i.xxActive#c.xx      , absorb(st0_date#instrumentid#xxActive mm#call st0_date#coun#xxActive     )    cluster(call   st0_date)
  estimates store ff4
   test 1.xxActive#c.xx = 0.xxActive#c.xx
     local gg2 = r(p)
        mat UALL[4,`gg'] = `gg2'

   
 	reghdfe yy  i.xxActive#c.xx   , absorb(st0_date#instrumentid#xxActive mm#call st0_date#coun#xxActive call#coun  )    cluster(call   st0_date)
  estimates store ff5
   test 1.xxActive#c.xx = 0.xxActive#c.xx
     local gg2 = r(p)
        mat UALL[5,`gg'] = `gg2'

	 local gg =  `gg' + 1
	}
  esttab ff*   ///
 , star("*" 0.1 "**" 0.05 "***" 0.01) b(%10.3f) t(%10.2f) scalars(N r2) sfmt(%10.3f)   replace
   
      esttab ff* using "RFSINTERACTION_`j'.tex" /*  using size_linear_`j'_DS2.tex using size_linear_`j'.tex  */   ///
   , star("*" 0.1 "**" 0.05 "***" 0.01) b(%10.3f) t(%10.2f) scalars(N r2) sfmt(%10.3f)   replace
}
   
   mat list UALL
   
   